all()

Check if everything in an iterable is True.

Example 1 We have a list of mathematical 'equivalencies'


In [2]:
lst = [2==0, 4==4, 2==1, 9==9, 9+4 == 13]
all(lst)


Out[2]:
False

any()

Checks if anything in an iterable is True.


In [4]:
any(lst)


Out[4]:
True